#ifndef ARG_H
#define ARG_H

extern char *argv0;

#define NUMARG                                                       \
	'0': case '1':                                                   \
	case '2':                                                        \
	case '3':                                                        \
	case '4':                                                        \
	case '5':                                                        \
	case '6':                                                        \
	case '7':                                                        \
	case '8':                                                        \
	case '9'

#define SHIFT_ARG_IF_DOESNT_EXIST                                    \
	if (!((++argv[0])[0]))                                           \
		argv++;                                                      \
	if (!argv[0])

#define ARGBEGIN                                                     \
	(void)argc;                                                      \
                                                                     \
	argv0 = argv[0];                                                 \
	while ((++argv)[0]) {                                            \
		if (argv[0][0] == '-')                                       \
			while ((++argv[0])[0])                                   \
				switch (argv[0][0])

#define NOFLAGARG else
#define ARGEND                                                       \
	__attribute__((__unused__)) next:;                               \
	}
#endif
